package com.example.software.dto;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

@Data
public class WorkerRegisterDTO {

    @NotBlank(message = "姓名不能为空")
    private String name;

    @NotBlank(message = "联系方式不能为空")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "请输入正确的手机号码")
    private String phone;

    @NotBlank(message = "身份证号不能为空")
    @Pattern(regexp = "(^\\d{15}$)|(^\\d{18}$)|(^\\d{17}(\\d|X|x)$)", message = "请输入正确的身份证号码")
    private String idCard;

    @NotBlank(message = "银行账户不能为空")
    private String bankAccount;

    @NotBlank(message = "擅长工种不能为空")
    private String skillType;

    @NotBlank(message = "用户名不能为空")
    @Size(min = 4, max = 16, message = "用户名长度必须在4-16个字符之间")
    @Pattern(regexp = "^[a-zA-Z0-9]+$", message = "用户名只能包含字母和数字")
    private String username;

    @NotBlank(message = "密码不能为空")
    @Pattern(regexp = "^(?=.*[A-Za-z])(?=.*\\d)[A-Za-z\\d]{8,20}$", message = "密码必须包含字母和数字，长度在8-20位之间")
    private String password;
    
    @JsonIgnore
    private String confirmPassword;
    
    @JsonIgnore
    private Boolean agreement;
} 